<?php $this->headTitle('List Role'); ?>
<?php $roleArray = $this->roleArray; ?>

<a href="<?php echo $this->url('user/process', array('controller' => 'role', 'action' => 'add')); ?>">Add Role</a>

<?php if(is_array($roleArray)): ?>
	<table>
		<tr>
			<th>
				ID
			</th>
			<th>
				Key
			</th>
			<th>
				Name
			</th>
			<th>
				
			</th>
		</tr>

	<?php foreach ($roleArray as $role):?>
		<tr>
			<td><?php echo $role['rid']; ?></td>
			<td><?php echo $role['key']; ?></td>
			<td><?php echo $role['name']; ?></td>
			<td>
				<a href="<?php echo $this->url('user/process', array('controller' => 'role', 'action' => 'update'), array('query' =>  array('id' => $role['rid'])) ); ?>">Update</a> | 
				<a href="<?php echo $this->url('user/process', array('controller' => 'role', 'action' => 'delete'), array('query' =>  array('id' => $role['rid'])) ); ?>">Delete</a>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php else: ?>
	<p>Không có role nào được cài đặt!</p>
<?php endif; ?>